// This example displays a marker at the center of Australia.
// When the user clicks the marker, an info window opens.

function retornaUrlMarkerImg(codigoTipoEvento)
{
	if (codigoTipoEvento == 'MUSIC')
	{
		return 'http://icons.iconarchive.com/icons/wwalczyszyn/iwindows/32/Music-Library-icon.png';
	}
	else if (codigoTipoEvento == 'THEATER')			
	{
		return 'http://icons.iconarchive.com/icons/icons-land/points-of-interest/32/Theater-Yellow-2-icon.png';
	}
	else if (codigoTipoEvento == 'MOVIES')
	{
		return 'http://icons.iconarchive.com/icons/hadezign/hobbies/32/Movies-icon.png';
	}
}

function getLegends()
{
	return {
		music: {
			desc: 'Música',
			url: 'http://icons.iconarchive.com/icons/wwalczyszyn/iwindows/32/Music-Library-icon.png'
		},
		theater: {
			desc: 'Teatro',
			url: 'http://icons.iconarchive.com/icons/icons-land/points-of-interest/32/Theater-Yellow-2-icon.png'
		},
		movies: {
			desc: 'Cinema',
			url: 'http://icons.iconarchive.com/icons/hadezign/hobbies/32/Movies-icon.png'
		}
	};
}

function initLegend(legendDiv)
{
	createLegendEntry(legendDiv, getLegends().music);
	createLegendEntry(legendDiv, getLegends().theater);
	createLegendEntry(legendDiv, getLegends().movies);
}

function createLegendEntry(legendDiv, legend)
{
	var name = legend.desc;
	var icon = legend.url;
	var div = document.createElement('div');
	div.innerHTML = '<img src="' + icon + '"> ' + name;
	legendDiv.appendChild(div);
}